All Functions Used So Far, Week 2

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

is.na

{base}

Check if a value is NA/elements of vector are NA

read_excel

{readxl}

Read an Excel file

c

{base}

Combine values/vectors into a vector

seq

{base}

Create a sequence

class

{base}

Retrieve class of an R object

head

{utils}

Show first 5 rows of a data frame

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

geom_bar

{GGPLOT2}

Generates a bar chart

recode

{dplyr}

Recode a variable

freq

{questionr}

Generate frequency tables

attach

{base}

Attach Set of R Objects to Search Path

slice

{dplyr}

Subset rows using their positions

mutate

{dplyr}

Modify/create a column in a data frame

hist

{graphics}

Plot a simple histogram

mean

{base}

Get mean of a vector

install.packages

{base}

Install R package

filter

{dplyr}

Filter out rows of a data frame according to logical vector

cbind

{base}

Combine R objects by columns

ggplot

{GGPLOT2}

Create a ggplot graph

boxplot

{graphics}

Plot a simple box plot

plot

{graphics}

Generic function from base R to produce a plot

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

var

{stats}

Calculate variance

sum

{base}

Get sum of numeric values or a vector

desc

{dplyr}

Arrange in descending order

pie

{graphics}

Creates a basic pie chart

str

{utils}

Get the structure of an R object

lprop

{questionr}

Display row percentages of a two-way frequency table

geom_histogram

{GGPLOT2}

Generates a histogram

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

dim

{base}

Get dimensions of a data frame

summary

{base}

Obtain summary statistics or detailed regression output

labs

{GGPLOT2}

Customise labels in GGPLOT2

select

{dplyr}

Select columns from a tibble/data frame

ordered

{dplyr}

Create an ordered factor

ls.str

{utils}

Similarly to ls, with a print() method that calls str() on each object

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

nrow

{base}

Get number of rows of a data frame

names

{base}

Retrieve names of a list/vector

read.spss

{foreign}

Read a .sav file (SPSS data)

min

{base}

Get minimum of a vector

ncol

{base}

Get number of columns of a data frame

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

View

{base}

View a data frame

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

library

{base}

Load an R package

factor

{base}

Create a factor

max

{base}

Get maximum of a vector

rbind

{base}

Combine R objects by rows

median

{stats}

Get median of a vector

sd

{stats}

Get standard deviation of a vector

levels

{base}

Get levels of a factor

rm

{base}

Remove objects

range

{base}

Return range of values

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

ifelse

{base}

Return a or b depending on the value of test

setwd

{base}

Set Working Directory

ungroup

{dplyr}

Resolve grouping created with “group_by”

cut

{base}

Convert Numeric to Factor

The end!